import request from '@/utils/request'


// 查询合同字段列表
export function getContractList(type) {
    return request({
      url: '/field/bizCrmField/list/'+type,
      method: 'post',
    })
}

// 查询合同模块字段列表
export function getContractListHead(type) {
    return request({
      url: '/field/bizCrmField/queryListHead/'+type,
      method: 'post',
    })
}

// 查询合同列表页数据
export function queryContractPageList(data) {
    return request({
      url: '/crm/crmContract/queryPageList',
      method: 'post',
      data: data
    })
  }

// 新增合同数据
export function addContract(data) {
  return request({
    url: '/crm/crmContract/add',
    method: 'post',
    data: data
  })
}

// 修改合同数据
export function updateContract(data) {
  return request({
    url: '/crm/crmContract/update',
    method: 'post',
    data: data
  })
}

// 根据ID查询信息 ---合同
export function queryById(data) {
  return request({
    url: '/crm/crmContract/queryById',
    method: 'post',
    data: data
  })
}

// 根据ID删除数据 --合同
export function deleteByIds(data) {
  return request({
    url: '/crm/crmContract/deleteByIds',
    method: 'post',
    data: data
  })
}

//查询详情页信息---合同
export function informationContract(customerId,data) {
  return request({
    url: '/crm/crmContract/information/'+customerId,
    method: 'post',
  })
}

//查询新增所需字段---合同
export function queryContractField(id) {
  return request({
    url: '/crm/crmContract/field/'+id,
    method: 'post',
  })
}

//根据ID查询---合同
export function queryByIdContract(customerId) {
  return request({
    url: '/crm/crmContract/queryById/'+customerId,
    method: 'post',
  })
}

//基本信息保存修改---合同
export function updateInformationContract(data) {
  return request({
    url: '/crm/crmContract/updateInformation',
    method: 'post',
    data:data,
  })
}

//客户标星
export function starContract(contractId) {
  return request({
    url: '/crm/crmContract/star/'+contractId,
    method: 'post',
  })
}
